import { IsNotEmpty, Length } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateUserDto {
    @ApiProperty({ description: '用户名' })
    @IsNotEmpty({ message: '用户名不能为空' })
    @Length(3, 20, { message: '用户名长度在3-20之间' })
    name: string;

    @ApiProperty({ description: '密码' })
    @IsNotEmpty({ message: '密码不能为空' })
    @Length(6, 40, { message: '密码长度在6-40之间' })
    password: string;
}
